var xxmlHttp;
function ajaxFunction(){
	//var xxmlHttp;
	try{
		// Firefox, Opera 8.0+, Safari
		xxmlHttp=new XMLHttpRequest();
	}catch (e){
		// Internet Explorer
		try{
			xxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("您的浏览器不支持AJAX！");
				return false;
			}
		}
	}
}


function scores(j,m){
	ajaxFunction();
	var url='./movie.php?id='+m+'&fen='+j;
	//alert(url);exit();
	xxmlHttp.open('GET',url,true);
	xxmlHttp.onreadystatechange = handelChange;//这一句最为关键，是ajax异步通讯的关键点
	xxmlHttp.send(null);		
}
function handelChange(){
	
	//var poDiv=document.getElementById("po");
	if(xxmlHttp.readyState == 4 && xxmlHttp.status == 200){
		var Strings = xxmlHttp.responseText;
		if(Strings=='nouid'){
			alert("请先登陆！！");
		}else if(Strings=='you'){
			alert("你已经评过分！！请不要重复评分");
		}else{
			arr = Strings.split('|');
			document.getElementById('num').innerHTML = arr[2];
			document.getElementById('xx').className = 'score '+arr[0];
			document.getElementById('score').innerHTML= arr[1];
		}
	}
}

function changebg(i){
	obj = document.getElementById("rate");
	objscore = document.getElementById("my_score");
	switch (i) {
	   case 0 :
	       objscore.innerHTML = '力荐';
	       obj.className = 'rate4';
	       break;
	   case 1 :
	       objscore.innerHTML = '推荐';
	       obj.className = 'rate3';
	       break;
	   case 2 :
	       objscore.innerHTML = '一般';
	       obj.className = 'rate2';
	       break;
	   case 3 :
	       objscore.innerHTML = '较差';
	       obj.className = 'rate1';
	       break;
	   case 4 :
	       objscore.innerHTML = '很差';
	       obj.className = 'rate';
	       break;
	   default :
	       objscore.innerHTML = '(滑动星星评价)';
	       obj.className = 'rate';
	}	
}